﻿using Entitas;
/// <summary>
/// once the collision has its target and has done its actions on the specified target we destory the entity
/// </summary>
class DestoryCollisionSystem : ICleanupSystem
{
    CollisionContext collisionContext;
    public DestoryCollisionSystem(Contexts contexts)
    {
        collisionContext = contexts.collision;
    }
    public void Cleanup()
    {
        foreach(var e in collisionContext.GetEntities())
        {
            if (e.hasTargetInformation)
                e.Destroy();
        }
        
    }
}
